<!DOCTYPE html>
<html>
<head>
<script src='../cspy/cspy.js' type='text/javascript'></script>
<script type='application/javascript;version=1.8'>
	'use strict';
	
	/*
	class A:
		aa = 'AA'
		
		def __call__(*args, **kwargs):
			return args, kwargs
	*/
	var A = builtins.call([builtins.type, 'A', [], {
		aa: 'AA',
		
		__call__: function (args, kwargs){
			return [args, kwargs];
		},
	}]);
	builtins.print([A]);
	
	var a = builtins.call([A]);
	builtins.print([a]);
	builtins.print([A, a]);
	
	var A_call = builtins.getattr([A, '__call__']);
	builtins.print([A_call]);
	builtins.print([builtins.call([A_call, 1, 2, 3])]);
	
	var a_call = builtins.getattr([a, '__call__']);
	builtins.print([a_call]);
	builtins.print([builtins.call([a_call, 1, 2, 3])]);
	
	function f(){
		yield 10;
	}
	
	var x = f();
	console.log([f, x.next()]);
</script>
</head>

<body>
</body>
</html>

